package com.longk.dao;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Results;  
import com.longk.moduel.User;
@Mapper
public interface UserMapper {
	 @Select("SELECT * FROM user where userid=#{userID}")
	    @Results({
	        @Result(property = "userID",  column = "userid"),
	        @Result(property = "username", column = "username"),
	        @Result(property = "password", column = "password")
	    })
	    User getUserById(String userID);
	 
	 
	 @Select("SELECT * FROM user where username=#{username}")
	    @Results({
	        @Result(property = "userID",  column = "userid"),
	        @Result(property = "username", column = "username"),
	        @Result(property = "password", column = "password")
	    })
	    User getUserByUsername(String username);
	 
	 @Select("SELECT * FROM user where username=#{username} and password=#{password}")
	    @Results({
	        @Result(property = "userID",  column = "userid"),
	        @Result(property = "username", column = "username"),
	        @Result(property = "password", column = "password")
	    })
	    User getUserByUsernameAndPass(@Param("username")String username,@Param("password")String password);
}
